package com.example.dormitorysystem.controller;


import com.example.dormitorysystem.service.SysService;
import com.example.dormitorysystem.utils.Response;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 吉吉王国组
 * @since 2022-11-26
 */
@RestController
@RequestMapping("/sys")
public class SysController {

    @Resource
    private SysService sysService;

    @GetMapping("/opentime")
    public Response getOpenTime(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> res = sysService.getOpenTime(request);
        return Response.success().data(res);
    }

    @GetMapping("/classlimit")
    public Response getClassLimit(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> res = sysService.getClassLimit(request);
        return Response.success().data(res);
    }

    @GetMapping("/groupnum")
    public Response getGroupNum(HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> res = sysService.getGroupNum(request);
        return Response.success().data(res);
    }

}

